package com.zzh.myapplication.activity;

import android.content.Intent;
import android.view.View;
import android.view.Window;

import net.icarplus.car.R;
import net.icarplus.car.manager.BaseActivity;
import net.icarplus.car.tools.SPUtils;

/**
 * Created by Administrator on 2016/3/21.
 */
public class SplashActivity extends BaseActivity {
    @Override
    public void setContent() {
        requestWindowFeature(Window.FEATURE_LEFT_ICON);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_splash);
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    Thread.sleep(1000);
                    Frist();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }).start();
    }

    @Override
    public void initComponent() {

    }

    @Override
    public void setListener() {

    }

    @Override
    public void onAfterInit() {
    }

    public void Frist() {
        boolean userGuide = SPUtils.getBoolean(SplashActivity.this, "frist", false);
        Intent intent = new Intent();
        if (userGuide == false) {
            intent.setClass(SplashActivity.this, GuidePageActivity.class);
            // 跳转到主界面
            startActivity(intent);
            finish();
        } else if (userGuide ==true){
            intent.setClass(SplashActivity.this, MainActivity.class);
            // 跳转到主界面
            startActivity(intent);
            finish();
        }
    }

    @Override
    public void onClick(View v) {

    }
}
